import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'

// CrudSchema https://doc.iocoder.cn/vue3/crud-schema/
const crudSchemas = reactive<CrudSchema[]>([
  {
    label: '案件名称',
    field: 'caseName',
    isSearch: true,
  },
  {
    label: '文件类型',
    field: 'fileType',
    isSearch: true,
    dictType: DICT_TYPE.ELEFILE_TYPE,
    form: {
      component: 'Select'
    },
    search:{
      component:"Select",
      formItemProps:{
        style:{
          width:'300px'
        }
      }
    }
  },
  
  {
    label: '被送达人姓名',
    field: 'acceptName',
    isSearch: true,
  },
  {
    label:'案件编号',
    field: 'caseNumber',
    isForm: false,
    table:{
      value:"<a>111</a>"
    }
  },
  {
    label: '签收状态',
    field: 'status',
    dictType: DICT_TYPE.ELECTRONDEL_STATUS,
  },
  {
    label: '创建人',
    field: 'creator',
  },
  {
    label: '创建时间',
    field: 'createTime',
    formatter: dateFormatter,
    isSearch: false,
    search: {
      component: 'DatePicker',
      componentProps: {
        valueFormat: 'YYYY-MM-DD HH:mm:ss',
        type: 'daterange',
        defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
      }
    },
    isForm: false,
  },
  {
    label: '操作',
    field: 'action',
    isForm: false,
    showOverflowTooltip:false,
    table:{
      width:"200px",
      fixed:"right",
    }
  }
])
export const { allSchemas } = useCrudSchemas(crudSchemas)
